const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    id: Number,
    title: String, //标题
    wordsNum: Number, //字数
    content: String, //内容
    createTime: String, //创建时间
    updateTime: String, //修改时间
    describe: {
        type: String,
        default: ''
    }, //描述
    articleType: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'articleType'
    },
    hide:{
        type: Boolean,
        default: false
    },
    like: { //喜欢次数
        type: Number,
        default: 0
    },
    discuss: {
        type: Number,
        default: 0
    },
    read: { //阅读次数
        type: Number,
        default: 0
    },
    music: { //背景音乐
        url: {
            type: String,
            default: ''
        },
        name: {
            type: String,
            default: ''
        }
    },
    image: { //logo
        url: {
            type: String,
            default: ''
        },
        name: {
            type: String,
            default: ''
        }
    }
})

module.exports = mongoose.model('Article', schema)